const countryMap = {
    "阿尔巴尼亚": [20.07020914892496, 41.14279623934419],
    "阿尔及利亚": [2.6744192005121477, 28.161383887500108],
    "阿富汗": [66.02594354641036, 33.833347334782786],
    "阿根廷": [-65.14760065867569, -35.197006103167325],
    "阿联酋": [53.74359130894186, 23.382545381404782],
    "阿鲁巴": [-69.96950896571047, 12.507837905839551],
    "阿曼": [57.87743663821527, 21.988064408262062],
    "阿塞拜疆": [47.65995096535363, 40.35241756631876],
    "埃及": [29.78045909541737, 26.560717892152923],
    "埃塞俄比亚": [39.63569306247558, 8.621804467371305],
    "爱尔兰": [-7.121430635590286, 53.25229867336236],
    "爱沙尼亚": [25.842955885593256, 58.685610122144624],
    "安道尔": [1.5762356610292727, 42.55065960302562],
    "安哥拉": [17.580049089922625, -12.339107807036726],
    "安提瓜和巴布达": [-61.79997550397877, 17.07761465670808],
    "奥地利": [14.14003387323379, 47.5885290742396],
    "奥兰群岛": [19.809464454071417, 60.15448486753553],
    "澳大利亚": [134.34950882321925, -25.57705569771298],
    "巴巴多斯": [-59.534648895580006, 13.136483526327197],
    "巴布亚新几内亚": [145.85930633561895, -6.756241275020102],
    "巴哈马": [-78.05111665804759, 24.695466120914034],
    "巴基斯坦": [69.3963916567264, 29.973204419499666],
    "巴拉圭": [-58.39333494763861, -23.2446708116957],
    "巴勒斯坦": [35.25559784714909, 31.943188359146802],
    "巴林": [50.54907598035595, 26.044075990693102],
    "巴拿马": [-78.64344406131931, 9.077616615392344],
    "巴西": [-53.08508266774129, -10.774933032076149],
    "白俄罗斯": [28.053623269729087, 53.54239045513492],
    "保加利亚": [25.238745052515867, 42.76534744462066],
    "北马里亚纳群岛": [145.7582100110136, 15.190995554391634],
    "贝宁": [2.3392839681148416, 9.649607868802036],
    "比利时": [4.660828314898197, 50.64179963775791],
    "冰岛": [-19.021169662499858, 64.79134928181753],
    "波多黎各": [-66.47591019385845, 18.227537988547],
    "波黑": [17.783988001183957, 44.17418803975579],
    "波兰": [19.406248982969544, 52.12210805650909],
    "玻利维亚": [-64.66197653743052, -16.710422384349783],
    "伯利兹": [-88.69973303388161, 17.197346334295673],
    "博茨瓦纳": [23.814331861583923, -22.188948584274613],
    "不丹": [90.44561683654581, 27.386799658142763],
    "布基纳法索": [-1.7455727532448009, 12.284939749987586],
    "布隆迪": [29.88657760820837, -3.3652468454645827],
    "朝鲜": [127.18068212006176, 40.1457684479621],
    "赤道几内亚": [10.466077984194385, 1.5660490018021846],
    "丹麦": [9.358118149238805, 56.26506215064478],
    "德国": [10.382147252837342, 51.090014291804096],
    "东帝汶": [125.94631256269122, -8.805539727308826],
    "多哥": [0.9772115485358768, 8.528412049363965],
    "多米尼加": [-70.4964270691869, 18.898456460112982],
    "俄罗斯": [99.14113255906233, 61.662502981321495],
    "厄瓜多尔": [-78.36812220699517, -1.4540284379948503],
    "厄立特里亚": [38.112743378054574, 16.130453132231423],
    "法国": [2.45564243271906, 46.628497778297174],
    "法罗群岛": [-7.122048735360806, 62.21228424370656],
    "法属波利尼西亚": [-149.40523675626855, -17.6770929554973],
    "法属圭亚那": [-53.233008109389004, 3.929533251796954],
    "法属南部领地": [69.64849090598057, -49.606856034248835],
    "菲律宾": [120.8601493835373, 14.16592313535972],
    "斐济群岛": [177.96608792200982, -17.83301534593602],
    "芬兰": [23.312943936213856, 61.916022831446924],
    "佛得角": [-23.635441475253344, 15.077918351151311],
    "冈比亚": [-15.311436176987968, 13.566611743568728],
    "刚果（布）": [15.24551619097474, -0.8314187679791303],
    "刚果（金）": [23.657696782007122, -2.8792266895275134],
    "哥伦比亚": [-73.07906720015569, 3.9061284700215992],
    "哥斯达黎加": [-84.19674712732086, 9.97113143862606],
    "格林纳达": [-61.682485628831216, 12.11238414739205],
    "格陵兰": [-41.393723949283014, 74.75625005285252],
    "格鲁吉亚": [43.368055343629294, 42.04663556064793],
    "古巴": [-79.54460144045402, 22.100303653985918],
    "瓜德罗普": [-61.6763032150198, 16.16115952475309],
    "关岛": [144.70293044993036, 13.354851495035405],
    "圭亚那": [-58.98035598027184, 4.793360258072596],
    "哈萨克斯坦": [67.30977716143309, 48.18186706155143],
    "海地": [-73.04597091632462, 18.32514168269597],
    "韩国": [127.86116864266558, 36.4512879348232],
    "荷兰": [5.364382743918611, 51.77313592955977],
    "荷兰加勒比区": [-68.30438232448466, 12.218878452382398],
    "荷属安德烈斯": [-68.94557571384809, 12.14225277624007],
    "赫德岛和麦克唐纳群岛": [73.52633629640405, -53.0910617759219],
    "黑山": [19.247272781433082, 42.78744259839482],
    "洪都拉斯": [-86.60077129780439, 14.818816999525666],
    "基里巴斯": [-157.2775115968327, 1.756888363457847],
    "吉布提": [42.18432712604607, 11.55969123763174],
    "吉尔吉斯斯坦": [74.48445400041362, 41.46475234893603],
    "几内亚": [-11.283844947736156, 11.002571546867898],
    "几内亚比绍": [-14.406775474208644, 12.117227258513878],
    "加拿大": [-101.81049374646824, 57.82104278350761],
    "加纳": [-1.2077679442394924, 7.962765993820824],
    "加蓬": [11.783801007847217, -0.6226973506027207],
    "柬埔寨": [104.92443503040477, 12.710646424779384],
    "捷克": [15.33447446693691, 49.73914840101071],
    "津巴布韦": [29.868761208394233, -19.000279818081424],
    "喀麦隆": [12.742934710050577, 5.697292133273095],
    "卡塔尔": [51.20118604283732, 25.305954643469136],
    "开曼群岛": [-81.17668151886198, 19.324985544473236],
    "科摩罗": [43.34234568343743, -11.66121734200783],
    "科特迪瓦": [-5.553956960335256, 7.623367237316074],
    "科威特": [47.49396705728395, 29.53688757320191],
    "克罗地亚": [17.96014380451811, 45.44831864009075],
    "肯尼亚": [37.85990590537591, 0.5354918824303354],
    "拉脱维亚": [26.424444674832046, 56.638684599891235],
    "莱索托": [28.25361996967348, -29.580414662795135],
    "老挝": [101.99404907243189, 20.27647255186986],
    "黎巴嫩": [35.89744427115721, 33.922323478729936],
    "立陶宛": [23.909752307516726, 55.335602803651966],
    "利比里亚": [-9.307184738363105, 6.447556604039619],
    "利比亚": [18.02925543220408, 27.040873685196004],
    "列支敦士登": [9.554016982048608, 47.14516838655135],
    "留尼汪": [55.540075965599726, -21.120823120116768],
    "卢森堡": [6.094805671137294, 49.777585348370565],
    "卢旺达": [29.92281855605802, -2.0027242234589835],
    "罗马尼亚": [24.985781466797505, 45.84320852450821],
    "马达加斯加": [46.69824180002604, -19.385170474496817],
    "马恩岛": [-4.541533720315726, 54.23055486029148],
    "马尔维纳斯群岛（福克兰）": [-58.75246823015391, -51.74562601899191],
    "马耳他": [14.445764444596989, 35.89189748716933],
    "马拉维": [33.48466777762087, -13.408882120294322],
    "马来西亚": [116.83463287315863, 5.452424351193713],
    "马里": [-3.526514688643374, 17.358095163737858],
    "马其顿": [21.70087201840596, 41.60030815910778],
    "马提尼克": [-60.919161796429705, 14.556077649595068],
    "马约特": [45.1401505946302, -12.822176923048573],
    "毛里求斯": [57.56802288149015, -20.285825868835445],
    "毛里塔尼亚": [-10.333208343570334, 20.26528920506877],
    "美国": [-99.43265397870618, 39.40041983621751],
    "美属萨摩亚": [-170.7187264402784, -14.3058729827207],
    "美属维尔京群岛": [-64.77214549789915, 17.73976192429251],
    "蒙古": [103.06843826676646, 46.837653087275214],
    "蒙塞拉特岛": [-62.19261224368995, 16.735583098418772],
    "孟加拉": [89.18966865613373, 22.865895535835932],
    "秘鲁": [-71.84017562855234, -13.583962428400923],
    "密克罗尼西亚联邦": [158.22521318487907, 6.8806691668443705],
    "缅甸": [96.51936995629251, 21.18781731980482],
    "摩尔多瓦": [28.468268356968622, 47.20572880765167],
    "摩洛哥": [-6.281162472220728, 31.848779241525676],
    "莫桑比克": [38.1865758897157, -14.26874550996314],
    "墨西哥": [-102.51535219243067, 23.934205253134223],
    "纳米比亚": [17.218603476100782, -22.14040541477982],
    "南非": [24.67699718542184, -30.001188462284688],
    "南苏丹": [30.349593432281438, 7.272753365217568],
    "尼泊尔": [83.94183859840086, 28.260776818648196],
    "尼加拉瓜": [-85.03375337255216, 12.840434511657577],
    "尼日尔": [9.400635532072329, 17.42407715361577],
    "尼日利亚": [8.092328096466758, 9.585410034446397],
    "纽埃": [-169.86016921014115, -19.05000441395663],
    "挪威": [11.478458403957234, 61.342772564699374],
    "帕劳": [134.57338577207724, 7.502308117975076],
    "葡萄牙": [-7.959857834501804, 39.68454840892679],
    "日本": [139.26840038439548, 36.65753686978013],
    "瑞典": [14.379242897242023, 60.590067052334405],
    "瑞士": [8.224472284418425, 46.97638686505479],
    "萨尔瓦多": [-88.8703252599654, 13.724754239697518],
    "萨摩亚": [-172.44307484755194, -13.615414721115599],
    "塞尔维亚": [20.804816307257113, 44.03039667582857],
    "塞拉利昂": [-11.782519215323305, 8.569747022750676],
    "塞内加尔": [-14.474179822574854, 14.361554784494729],
    "塞浦路斯": [33.234918234134625, 35.04924310739881],
    "塞舌尔": [55.46561771106502, -4.678057787644946],
    "沙特阿拉伯": [44.517897895153, 24.128635062685305],
    "圣诞岛": [105.64261110582362, -10.488246103570873],
    "圣多美和普林西比": [6.609772322054084, 0.24155498025163524],
    "圣赫勒拿": [-5.712561530752339, -15.958030149632691],
    "圣基茨和尼维斯": [-62.76628612659084, 17.33994218565948],
    "圣卢西亚": [-60.96529555124192, 13.894055938764154],
    "圣皮埃尔和密克隆": [-56.33682441731298, 46.85812656377601],
    "圣文森特和格林纳丁斯": [-61.1902432212521, 13.246279878223959],
    "斯里兰卡": [80.70539707536796, 7.620950831479377],
    "斯洛伐克": [19.487011961724193, 48.70656579554901],
    "斯洛文尼亚": [14.974541664416336, 46.0654090195157],
    "斯瓦尔巴群岛和扬马延岛": [13.380715370018493, 78.82894071712775],
    "斯威士兰": [31.501492158157134, -26.564708575686893],
    "苏丹": [30.004499848393323, 16.048315252245573],
    "苏里南": [-55.91706720454465, 4.132260174597661],
    "所罗门群岛": [160.15841245258503, -9.622391349400516],
    "索马里": [46.20083046000775, 4.400309155014384],
    "塔吉克斯坦": [69.32827002516672, 38.38987070936946],
    "泰国": [101.02466942631628, 15.13586102636475],
    "坦桑尼亚": [34.810130313463844, -6.265970896377496],
    "汤加": [-175.19599914559404, -21.195112559977645],
    "特克斯和凯科斯群岛": [-71.74512100203253, 21.807805848053533],
    "特立尼达和多巴哥": [-61.293895081716755, 10.418772532304388],
    "突尼斯": [9.572598715548565, 34.12037691183514],
    "土耳其": [35.43414052072433, 38.98914746369087],
    "土库曼斯坦": [59.178781266879355, 39.194152225297216],
    "瓦努阿图": [167.06797790513144, -15.344451649239602],
    "危地马拉": [-91.2369194034327, 15.004860380640821],
    "委内瑞拉": [-66.16035695815083, 7.1241258994705845],
    "文莱": [114.6274380828196, 4.498406918166381],
    "乌干达": [32.388470568932746, 1.281574836211746],
    "乌克兰": [31.410429543163218, 49.00929300798492],
    "乌拉圭": [-56.013100981216496, -32.80164940214178],
    "乌兹别克斯坦": [63.35304750306426, 41.61771827410354],
    "西班牙": [-3.5516145016286487, 40.39313545109144],
    "西撒哈拉": [-13.138020072345228, 24.673945835988206],
    "希腊": [22.58747419558557, 39.477190755672154],
    "新加坡": [103.81078949817669, 1.3610085329710842],
    "新喀里多尼亚": [165.5067367556469, -21.417434750719224],
    "新西兰": [170.47558057756692, -43.98724985647385],
    "匈牙利": [19.417911561270614, 47.166145887102914],
    "叙利亚": [38.515107707804134, 35.02674474093135],
    "牙买加": [-77.31068409993924, 18.156168605683376],
    "亚美尼亚": [44.93761004768055, 40.29399911120146],
    "也门": [45.2235136030954, 15.222460799262763],
    "伊拉克": [43.765108699175585, 33.050914426917586],
    "伊朗": [54.30395113529812, 32.56732966673633],
    "以色列": [34.67314529402023, 31.04352935953193],
    "意大利": [12.56416678431981, 42.80274332259199],
    "印度": [79.25636869444429, 22.772454106721],
    "印尼": [113.91740035993882, -0.9953244803916164],
    "英国": [-0.23965278327432316, 52.2486107224334],
    "约旦": [37.12959098878315, 30.6539377827836],
    "越南": [105.80465887805485, 10.104345222032805],
    "赞比亚": [27.852537154965773, -14.596892380772033],
    "泽西岛": [-2.1410555840479333, 49.229247068363236],
    "乍得": [18.666602730763543, 15.364898904062272],
    "智利": [-71.22685823164335, -35.25849351529075],
    "中非": [20.94175910969517, 6.997427801621711],
    "中国": [103.73456668148236, 36.56057249607403]
}
const bottom = {
    "xbsjType": "CustomPrimitive",
    "evalString": "\n                    p.canvasWidth = 512;\n                    p.canvasHeight = 512;\n                    p.drawCanvas(ctx => {\n                        var gradient = ctx.createRadialGradient(256, 256, 0, 256, 256, 256);\n                        gradient.addColorStop(0.1, \"rgba(255, 255, 255, 1.0)\");\n                        gradient.addColorStop(0.2, \"rgba(255, 255, 255, 0.0)\");\n                        gradient.addColorStop(0.3, \"rgba(255, 255, 255, 0.9)\");\n                        gradient.addColorStop(0.5, \"rgba(255, 255, 255, 0.0)\");\n                        gradient.addColorStop(0.9, \"rgba(255, 255, 255, 0.2)\");\n                        gradient.addColorStop(1.0, \"rgba(255, 255, 255, 1.0)\");\n\n                        ctx.clearRect(0, 0, 512, 512);\n                        ctx.beginPath();\n                        ctx.arc(256, 256, 256, 0, Math.PI * 2, true);\n                        // ctx.fillStyle = \"rgb(0, 155, 255)\";\n                        ctx.fillStyle = gradient;\n                        ctx.fill();\n                        ctx.restore();\n                    });\n                ",
    "position": [
        0,
        0,
        0
    ],
    "scale": [
        1,
        1,
        1
    ],
    "positions": [-1, -1,
        0,
        1, -1,
        0,
        1,
        1,
        0, -1,
        1,
        0
    ],
    "sts": [
        0,
        0,
        1,
        0,
        1,
        1,
        0,
        1
    ],
    "indices": [
        0,
        1,
        2,
        0,
        2,
        3
    ],
    "renderState": {
        "blending": {
            "enabled": true,
            "color": {},
            "equationRgb": 32774,
            "equationAlpha": 32774,
            "functionSourceRgb": 770,
            "functionDestinationRgb": 771,
            "functionDestinationAlpha": 771
        },
    },
    "color": [
        0.5,
        0.8,
        1,
        2
    ],
    "canvasWidth": 512,
    "canvasHeight": 512,
    "autoRegisterEditing": true
}

const beam = {
    "xbsjType": "CustomPrimitive",
    "position": [
        2.3538844649332518,
        0.7751154943351763,
        4.31836512661339e-9
    ],
    "scale": [
        3,
        3,
        300
    ],
    "positions": [
        2,
        0,
        0,
        1.0000000000000002,
        1.7320508075688772,
        0, -0.9999999999999996,
        1.7320508075688774,
        0, -2,
        2.4492935982947064e-16,
        0, -1.0000000000000009, -1.732050807568877,
        0,
        0.9999999999999987, -1.732050807568878,
        0,
        2, -4.898587196589413e-16,
        0,
        0.3,
        0,
        1,
        0.15000000000000002,
        0.25980762113533157,
        1, -0.14999999999999994,
        0.2598076211353316,
        1, -0.3,
        3.6739403974420595e-17,
        1, -0.15000000000000013, -0.2598076211353315,
        1,
        0.1499999999999998, -0.2598076211353317,
        1,
        0.3, -7.347880794884119e-17,
        1
    ],
    "sts": [
        0,
        0,
        0.16666666666666666,
        0,
        0.3333333333333333,
        0,
        0.5,
        0,
        0.6666666666666666,
        0,
        0.8333333333333334,
        0,
        1,
        0,
        0,
        1,
        0.16666666666666666,
        1,
        0.3333333333333333,
        1,
        0.5,
        1,
        0.6666666666666666,
        1,
        0.8333333333333334,
        1,
        1,
        1
    ],
    "indices": [
        0,
        1,
        7,
        1,
        8,
        7,
        1,
        2,
        8,
        2,
        9,
        8,
        2,
        3,
        9,
        3,
        10,
        9,
        3,
        4,
        10,
        4,
        11,
        10,
        4,
        5,
        11,
        5,
        12,
        11,
        5,
        6,
        12,
        6,
        13,
        12
    ],
    "fragmentShaderSource": "\n                varying vec3 v_positionEC;\n                varying vec3 v_normalEC;\n                varying vec2 v_st;\n                varying vec4 v_color;\n                uniform sampler2D u_image;\n                uniform vec4 u_color;\n                void main()\n                {\n                    float powerRatio = fract(czm_frameNumber / 30.0) + 1.0;\n                    float alpha = pow(1.0 - v_st.t, powerRatio);\n                    gl_FragColor = vec4(u_color.rgb, alpha*u_color.a);\n                }\n                ",
    "renderState": {
        "cull": {},
        "polygonOffset": {},
        "scissorTest": {
            "rectangle": {}
        },
        "depthRange": {},
        "depthTest": {
            "enabled": true
        },
        "colorMask": {},
        "depthMask": false,
        "blending": {
            "enabled": true,
            "color": {},
            "equationRgb": 32774,
            "equationAlpha": 32774,
            "functionSourceRgb": 770,
            "functionDestinationRgb": 771,
            "functionDestinationAlpha": 771
        },
        "stencilTest": {
            "frontOperation": {},
            "backOperation": {}
        },
        "sampleCoverage": {}
    },
    "color": [
        0.5,
        0.8,
        1,
        2
    ],
    "canvasWidth": 1,
    "autoRegisterEditing": true
}

const flash = {
    "xbsjType": "CustomPrimitive",
    "xbsjGuid": "64103eb1-6722-4ff1-8d5d-e0e31c6b09fc",
    "evalString": "\n                    p.canvasWidth = 32;\n                    p.canvasHeight = 256;\n                    Cesium.Resource.createIfNeeded('./static/assets/city/particles.png').fetchImage().then(function(image) {\n                        p.drawCanvas(ctx => {\n                            ctx.clearRect(0, 0, 32, 256);\n                            ctx.drawImage(image, 0, 0);\n                        });\n                    });\n                ",
    "position": [
        1.1595750072190083,
        0.3275656942546615,
        4.656612873077393e-10
    ],
    "scale": [
        3000,
        3000,
        300000
    ],
    "positions": [
        4,
        0,
        0,
        2.0000000000000004,
        3.4641016151377544,
        0, -1.9999999999999991,
        3.464101615137755,
        0, -4,
        4.898587196589413e-16,
        0, -2.0000000000000018, -3.464101615137754,
        0,
        1.9999999999999973, -3.464101615137756,
        0,
        4, -9.797174393178826e-16,
        0,
        4,
        0,
        1,
        2.0000000000000004,
        3.4641016151377544,
        1, -1.9999999999999991,
        3.464101615137755,
        1, -4,
        4.898587196589413e-16,
        1, -2.0000000000000018, -3.464101615137754,
        1,
        1.9999999999999973, -3.464101615137756,
        1,
        4, -9.797174393178826e-16,
        1
    ],
    "sts": [
        0,
        0,
        0.16666666666666666,
        0,
        0.3333333333333333,
        0,
        0.5,
        0,
        0.6666666666666666,
        0,
        0.8333333333333334,
        0,
        1,
        0,
        0,
        1,
        0.16666666666666666,
        1,
        0.3333333333333333,
        1,
        0.5,
        1,
        0.6666666666666666,
        1,
        0.8333333333333334,
        1,
        1,
        1
    ],
    "indices": [
        0,
        1,
        7,
        1,
        8,
        7,
        1,
        2,
        8,
        2,
        9,
        8,
        2,
        3,
        9,
        3,
        10,
        9,
        3,
        4,
        10,
        4,
        11,
        10,
        4,
        5,
        11,
        5,
        12,
        11,
        5,
        6,
        12,
        6,
        13,
        12
    ],
    "fragmentShaderSource": "\n                varying vec3 v_positionEC;\n                varying vec3 v_normalEC;\n                varying vec2 v_st;\n                varying vec4 v_color;\n                uniform sampler2D u_image;\n                uniform vec4 u_color;\n                void main()\n                {\n                    vec3 positionToEyeEC = -v_positionEC;\n                    vec3 normalEC = normalize(v_normalEC);\n                    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n\n                    float dt = fract(czm_frameNumber / 90.0);\n                    vec2 st = fract(vec2(1.0) + v_st - vec2(dt, dt));\n                    vec4 imageColor = texture2D(u_image, st);\n\n                    vec3 diffuse = imageColor.rgb;\n                    float alpha = imageColor.a;\n\n                    diffuse *= v_color.rgb;\n                    alpha *= v_color.a;\n\n                    diffuse *= u_color.rgb;\n                    alpha *= u_color.a;\n\n                    gl_FragColor = vec4(diffuse, alpha * pow(1.0 - v_st.t, 2.0));\n                }\n                ",
    "renderState": {
        "cull": {},
        "polygonOffset": {},
        "scissorTest": {
            "rectangle": {}
        },
        "depthRange": {},
        "depthTest": {
            "enabled": true
        },
        "colorMask": {},
        "depthMask": false,
        "blending": {
            "enabled": true,
            "color": {},
            "equationRgb": 32774,
            "equationAlpha": 32774,
            "functionSourceRgb": 770,
            "functionDestinationRgb": 771,
            "functionDestinationAlpha": 771
        },
        "stencilTest": {
            "frontOperation": {},
            "backOperation": {}
        },
        "sampleCoverage": {}
    },
    "color": [
        0.5,
        0.8,
        1,
        2
    ],
    "canvasWidth": 32,
    "canvasHeight": 256,
    "autoRegisterEditing": true
}
const colorLegend = [
    [118 / 255, 22 / 255, 26 / 255, 2],
    [201 / 255, 47 / 255, 49 / 255, 2],
    [227 / 255, 102 / 255, 84 / 255, 2],
    [242 / 255, 168 / 255, 141 / 255, 2],
    [250 / 255, 230 / 255, 210 / 255, 2],
    [1, 1, 1, 2]
]

function getAreaColor(confirmedCount) {
    if (confirmedCount >= 1000) {
        return colorLegend[0];
    } else if (confirmedCount >= 500) {
        return colorLegend[1];
    } else if (confirmedCount >= 100) {
        return colorLegend[2];
    } else if (confirmedCount >= 10) {
        return colorLegend[3];
    } else {
        return colorLegend[4];
    }
}

function createBottom(country, earth) {
    if (!countryMap[country.name]) {
        console.log(country.name);
        return;
    }
    var x = countryMap[country.name][0];
    var y = countryMap[country.name][1];
    var scale = 100000 + country.confirmedCount * 40;
    scale = scale > 300000 ? 300000 : scale;
    var p = new XE.Obj.CustomPrimitive(earth)
    p.xbsjFromJSON(bottom);
    p.position[0] = x * Math.PI / 180;
    p.position[1] = y * Math.PI / 180;
    p.scale[0] = scale;
    p.scale[1] = scale;
    p.color = getAreaColor(country.confirmedCount);
    p.label = country;
    return p;
}

function createBeam(country, earth) {
    if (!countryMap[country.name]) {
        console.log(country.name);
        return;
    }
    var x = countryMap[country.name][0];
    var y = countryMap[country.name][1];
    var scale = 8000 + country.confirmedCount * 1.5;
    scale = scale > 20000 ? 20000 : scale;
    var p = new XE.Obj.CustomPrimitive(earth)
    p.xbsjFromJSON(beam);
    p.position[0] = x * Math.PI / 180;
    p.position[1] = y * Math.PI / 180;
    p.scale[0] = scale;
    p.scale[1] = scale;
    p.scale[2] = scale * 100;
    p.color = getAreaColor(country.confirmedCount);
    p.label = country;
    return p;
}

function createFlash(country, earth) {
    if (!countryMap[country.name]) {
        console.log(country.name);
        return;
    }
    var x = countryMap[country.name][0];
    var y = countryMap[country.name][1];
    var scale = 8000 + country.confirmedCount * 1.5;
    scale = scale > 20000 ? 20000 : scale;
    var p = new XE.Obj.CustomPrimitive(earth)
    p.xbsjFromJSON(flash);
    p.position[0] = x * Math.PI / 180;
    p.position[1] = y * Math.PI / 180;
    p.scale[0] = scale;
    p.scale[1] = scale;
    p.scale[2] = scale * 100;
    p.color = getAreaColor(country.confirmedCount);
    p.label = country;
    return p;
}

function createBeams(country, earth) {
    return [createBottom(country, earth), createBeam(country, earth), createFlash(country, earth)]
}
export default createBeams;